package ig.metrica.ui.formatos;

import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import ig.metrica.ui.PantallaSevinproPanel;
import javax.swing.JComboBox;

public class PantallaDatosBasicosFormatos extends PantallaSevinproPanel {

	private JTextField txtCodigo;
	private JTextField txtNombre;

    private JComboBox[] comboBoxsColumns=new JComboBox[1];

    @Override
    public JComboBox[] getComboBoxsColumnsTable1() {
        return comboBoxsColumns;
    }

    private JComboBox[] comboBoxsColumnsTable2=new JComboBox[1];
    @Override
    public JComboBox[] getComboBoxsColumnsTable2() {
        return comboBoxsColumnsTable2;
    }


	public PantallaDatosBasicosFormatos(){
		
		JPanel panelSuperior;
		
		setLayout( new BorderLayout() );
		
		//int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, Insets insets, int ipadx, int ipady
		
		add( panelSuperior = new JPanel(), BorderLayout.NORTH );
			panelSuperior.setLayout( new GridBagLayout() );
			panelSuperior.setBorder( BorderFactory.createEmptyBorder(10, 10, 0, 10) );
			//----------
			panelSuperior.add( new JLabel(), new GridBagConstraints(0, 0, 1, 1, 0.4, 0.1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0) );
			panelSuperior.add( new JLabel("Codigo"), new GridBagConstraints(1, 0, 1, 1, 0.1, 0.1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0) );
			panelSuperior.add( new JLabel("Nombre"), new GridBagConstraints(1, 1, 1, 1, 0.1, 0.1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0) );
			panelSuperior.add( new JLabel(), new GridBagConstraints(2, 0, 1, 1, 0.1, 0.1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0) );
			panelSuperior.add( txtCodigo = new JTextField(), new GridBagConstraints(3, 0, 1, 1, 1, 0.1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0) );
			panelSuperior.add( txtNombre = new JTextField(), new GridBagConstraints(3, 1, 1, 1, 1, 0.1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0) );
			panelSuperior.add( new JLabel(), new GridBagConstraints(4, 0, 1, 1, 0.4, 0.1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0) );
                        txtNombre.setDisabledTextColor(new java.awt.Color(0, 0, 0));
                        txtCodigo.setDisabledTextColor(new java.awt.Color(0, 0, 0));
	}

	public String getTitulo() {
		return "Datos Basicos de Formato de Normativa";
	}

	public void setModificable(boolean b) {
		txtNombre.setEnabled(b);
		txtCodigo.setEnabled(b);
	}

	public void setModificable2() {
		txtCodigo.setEnabled(false);
	}
	
	public void limpiarCampos() {
		txtNombre.setText("");
		txtCodigo.setText("");
	}
	
	public String getNombre(){
		return txtNombre.getText();
	}

	public String getCodigo(){
		return txtCodigo.getText();
	}
	
	
	public void setNombre(String nombre){
		txtNombre.setText(nombre);
                updateUI();
	}
	
	public void setCodigo(int codigo){
		txtCodigo.setText(codigo+"");
                updateUI();
	}

    public void salir() throws Exception {
    }

    public javax.swing.table.AbstractTableModel getClonModelTable_1() throws CloneNotSupportedException{
        return null;
    }

    public javax.swing.table.AbstractTableModel getClonModelTable_2() throws CloneNotSupportedException{
        return null;
    }

    public javax.swing.table.AbstractTableModel getClonModelTable_3() throws CloneNotSupportedException{
        return null;
    }

}
